
package com.db.logging;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class LogTest {

    private final Logger logger = LoggerFactory.getLogger(LogTest.class);

    public void test() {
        for (int i = 0; i < 10; ++i) {
            if (logger.isTraceEnabled()) {
                logger.trace("iteration # {}", i);
            }

            if (logger.isDebugEnabled()) {
                logger.debug("iteration # {}", i);
            }
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
            }
        }
    }

    public static void main(String[] args) {
        LogTest test = new LogTest();
        test.test();
    }
}

